﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.Composition;
using Core.Interfaces;
using Core.Common;
using Core.DataAccess;

namespace Core.Components
{
    [Export(typeof(IUserSession))]
    public class UserSession : IUserSession
    {
        [Import]
        private IWebContext _webContext;
        public UserSession()
        {
            MEFManager.Compose(this);
        }


        public bool IsLogged
        {
            get { return _webContext.IsLogged; }
            set { _webContext.IsLogged = value; }
        }

        public string UserName
        {
            get { return _webContext.UserName; }
            set { _webContext.UserName = value; }
        }

        public Account CurrentUser
        {
            get { return _webContext.CurrentUser; }
            set { _webContext.CurrentUser = value; }
        }

        public int OtherAccountID
        {
            get { return _webContext.OtherAccountID; }
            set { _webContext.OtherAccountID = value; }
        }
    }
}
